#ifndef TIMEVAL_H
#define TIMEVAL_H


#include <sys/time.h>
#include <time.h>


#define ACE_ONE_SECOND_IN_MSECS 1000L
#define ACE_ONE_SECOND_IN_USECS 1000000L
#define ACE_ONE_SECOND_IN_NSECS 1000000000L


void tv_normalize(struct timeval* tv_);

unsigned long to_msec(struct timeval tv_);

struct timeval tv_msec(unsigned long milliseconds);


struct timeval tv_gettimeofday();

struct timeval tv_add(struct timeval tv1, struct timeval tv2);
struct timeval tv_sub(struct timeval tv1, struct timeval tv2);
int tv_bigthan(struct timeval tv1, struct timeval tv2);

#endif